#pragma once
#include <IL/il.h>
#include <IL/ilu.h>
#include <IL/ilut.h>
#include <string>
#include <cstdlib>

class SpriteFixer
{
private:
	int mTextureSizeX, mTextureSizeY;
	int mNumRows, mNumColumns;
	unsigned char* mData;

	ILenum _detectType( std::string str );

public:
	SpriteFixer(void);
	~SpriteFixer(void);
	void Init(int textureSizeX, int textureSizeY, int numRows, int numColumns);
	// Offset and size arguments are of the texture in path
	void AddTexture(int row, int column, std::string path, int xOffset=0, int yOffset=0, int xSize=-1, int ySize=-1, bool makeBackgroundTransparent=true, int backgroundPixelX=0, int backgroundPixelY=0);
	void SaveTexture(std::string path);

};

